﻿
@{
    ViewBag.Title = "用户管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
    .left,.right{
        position:absolute;
        top:0;
        left:0px;
        width:300px;
        height:100%;
        z-index:8;
        border-right:1px gray solid;
        padding-top:60px;
    }

    #depteditbar{
        position:absolute;
        top:0;
        left:5px;
        height:35px;
        padding:60px 0 0 5px;
        z-index:8;
    }
    #tree{
        position:absolute;
        top:0;
        left:0;
        width:300px;
        height:100%;
        z-index:7;
        padding:95px 5px 0 5px;
    }
    .right{
        width:100%;
        padding:60px 5px 5px 305px;
        z-index:6;
    }

    #usereditbar,.usertable{
        
    }
    .usertable{
        margin-top:5px;
        width:100%;
    }
</style>
<div class="left">
    <div class="btn-group"  id="depteditbar">
        <button id="btnAddDept" class="btn btn-primary" data-toggle="modal" data-target="#deptEdit">新增部门</button>
        <button id="btnModifyDept" class="btn btn-primary" data-toggle="modal" data-target="#deptEdit">修改部门</button>
        <button id="btnDeleteDept" class="btn btn-danger">删除部门</button>
    </div>
    <div id="tree" class="scrollbar">
    </div>
</div>
<div class="right">
    <div class="btn-group" id="usereditbar">
        <button id="btnAddUser" class="btn btn-primary" data-toggle="modal" data-target="#userEdit">新增人员</button>
        <button id="btnDeleteUser" class="btn btn-danger">删除人员</button>
    </div>
    <div class="usertable">
        <table id="usertable"></table>
    </div>
</div>
<!-- Modal -->
<div class="modal fade" id="userEdit" tabindex="-1" role="dialog" aria-labelledby="userEditLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="userEditLabel">新增人员</h4>
            </div>
            <div class="modal-body">
                <form id="userEditForm">
                    <input type="hidden" name="ID" value="0">
                    <input type="hidden" name="DeptID" value="0">
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">账号</label>
                        </div>
                        <div class="col col-sm-8">
                            <input type="text" class="form-control" name="LoginName" placeholder="请输入账号" maxlength="20" data-bv-notempty="true">
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">密码</label>
                        </div>
                        <div class="col col-sm-8">
                            <input type="password" class="form-control" name="Password" placeholder="请输入密码" maxlength="50"  data-bv-notempty="true">
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">部门</label>
                        </div>
                        <div class="col col-sm-8">
                            <a href="#" id="deptName">请选择部门</a>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">姓名</label>
                        </div>
                        <div class="col col-sm-8">
                            <input type="text" class="form-control" name="RealName" placeholder="请输入姓名" maxlength="20" data-bv-notempty="true">
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">状态</label>
                        </div>
                        <div class="col col-sm-8">
                            <select class="form-control" name="State">
                                <option value="1">正常</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">备注</label>
                        </div>
                        <div class="col col-sm-8">
                            <textarea class="form-control" name="Remark" placeholder="请输入备注"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button"  class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" id="btnSaveUser" data-loading-text="提交中..." autocomplete="off" class="btn btn-primary">确定</button>
            </div>
        </div>
    </div>
</div>
<!-- Modal -->
<div class="modal fade" id="deptEdit" tabindex="-1" role="dialog" aria-labelledby="deptEditLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="deptEditLabel">新增部门</h4>
            </div>
            <div class="modal-body">
                <form id="deptEditForm">
                    <input type="hidden" name="ID" value="0">
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">父部门</label>
                        </div>
                        <div class="col col-sm-8">
                            <input type="text" class="form-control" name="ParentID" placeholder="请输入父部门">
                        </div>
                    </div>  
                    <div class="row form-group">
                        <div class="col col-sm-3 text-right">
                            <label class="label-margin-top input-notempty">部门名称</label>
                        </div>
                        <div class="col col-sm-8">
                            <input type="text" class="form-control" name="Name" placeholder="请输入部门名称" maxlength="20" data-bv-notempty="true">
                        </div>
                    </div>                                      
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" id="btnSaveDept" data-loading-text="提交中..." autocomplete="off" class="btn btn-primary">确定</button>
            </div>
        </div>
    </div>
</div>
@section scripts{
    <script type="text/javascript" src="~/Scripts/usermanage.js"></script>
    <script>
        $(function () {
            _usermange.init();           
        });
    </script>
}
